UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nNo9f7cY0d+lcIwQfDaNMbjwvWlqGEbNpxPIoX1iTfo=' 
WHERE 
  key_id = 'fc5537aeeeb22b76dd4b7edc674e9eccef9658def7a21aa7f5d11cc79b3bc2a6' 
  AND (
    token = 'nNo9f7cY0d+lcIwQfDaNMbjwvWlqGEbNpxPIoX1iTfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025