UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k8B/Vvs13eSG64bXxrX1fHa21oSI/gA5bJkZdnMTZNY=' 
WHERE 
  key_id = '4abb3f538465a698cc1fc46d99b21cc588c01f9210bd1c36cc40c74534a911e5' 
  AND (
    token = 'k8B/Vvs13eSG64bXxrX1fHa21oSI/gA5bJkZdnMTZNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025