UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GHlcHO5q7vCV1b3duvTA5ODo6MIWQtsxLWAUypRETBc=' 
WHERE 
  key_id = '1bc0eb24bc972156552500c5f488f541af0ba7dd7b3076c66e44d6934c2d93e0' 
  AND (
    token = 'GHlcHO5q7vCV1b3duvTA5ODo6MIWQtsxLWAUypRETBc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060