UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LptE/+y/Kx2LgauBCFSOVrYDFGC5musACg/2H6po6b0=' 
WHERE 
  key_id = '1557790cad4fbec8b416f1a3e20e9d8174aec3c32bc0541fe8213a7abb2304ec' 
  AND (
    token = 'LptE/+y/Kx2LgauBCFSOVrYDFGC5musACg/2H6po6b0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026