UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0duQqucdGUdPffWbdMieVRenOWzPnfJ/HI9IuDbBeZI=' 
WHERE 
  key_id = '4ea3cc47257da1e57178121f814b88ff32a3e2d99ed990e6a51ad126c3801fb2' 
  AND (
    token = '0duQqucdGUdPffWbdMieVRenOWzPnfJ/HI9IuDbBeZI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042