UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ee4NehJh3MQHD8Jql/WgFbB3q4M+xigqRstVqAkf858=' 
WHERE 
  key_id = '1e3193fbc3a0592f6c3cb775efeef8bfde8dc4f08a574c15333b73a34de8b29b' 
  AND (
    token = 'ee4NehJh3MQHD8Jql/WgFbB3q4M+xigqRstVqAkf858=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00090