UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3YKLt0/vlNLjmfaQl8PqFa8UT5nGbZIqWN+SVS1Izls=' 
WHERE 
  key_id = '4eadb5b4f34ad88cfff28636f22360148e92005c9f374d797b7624b2d3c6dba0' 
  AND (
    token = '3YKLt0/vlNLjmfaQl8PqFa8UT5nGbZIqWN+SVS1Izls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040