UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mqEiJwIJ9rtiG/KXjbJwC4VsPO1F7oeDTNhVTTArfRQ=' 
WHERE 
  key_id = 'fd0247b0b5afe948ab186f01497300d7998bc936443a5cb6b89668305719a4b9' 
  AND (
    token = 'mqEiJwIJ9rtiG/KXjbJwC4VsPO1F7oeDTNhVTTArfRQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033