UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z/pdybyxxVoxq8dMCUzG2nfEj6/VKsfnAD+bd5JfWbM=' 
WHERE 
  key_id = 'ddf5773770e7b17f2bd928e426844a2f0caec52bdbfe93b87dbb8444780c7a60' 
  AND (
    token = 'Z/pdybyxxVoxq8dMCUzG2nfEj6/VKsfnAD+bd5JfWbM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020