UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rD9S2Ts6MOcw8dkSvLtsQi9NXLOc6/cJtrIWilmaqKU=' 
WHERE 
  key_id = '9efa2b9931bcec7663224705bfb455ba4de9d1ee68d069eca4c0ed3a1094e857' 
  AND (
    token = 'rD9S2Ts6MOcw8dkSvLtsQi9NXLOc6/cJtrIWilmaqKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025