UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eVDOkzDXtq/pz75in9+gTQCl1MWyNQbV5SJ5z5Msvlo=' 
WHERE 
  key_id = 'e134bbe8d558c7b947cfa67c86d02db750cc5a622d143bfc097de44625151bfe' 
  AND (
    token = 'eVDOkzDXtq/pz75in9+gTQCl1MWyNQbV5SJ5z5Msvlo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026