UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VbiotbAQJ9dq7/5Ne6SqVNiV+KvJCtIwCQgozPyySBs=' 
WHERE 
  key_id = '37c41b25d6ba877b571f08d41fc5e03070987e245699233af89ff87718367b3a' 
  AND (
    token = 'VbiotbAQJ9dq7/5Ne6SqVNiV+KvJCtIwCQgozPyySBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039