UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zgxPjpMVng52g9i6UIcekEoER9ICdY23tL/5n3nnB8I=' 
WHERE 
  key_id = 'fe0b5d0a00bcf9883741650a3b0d7b7731bd08e3005f391c8ae4e99376b1b4aa' 
  AND (
    token = 'zgxPjpMVng52g9i6UIcekEoER9ICdY23tL/5n3nnB8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044