UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bSK1sEDLj+Xc2yelHK/mtR116pjIxJqT93rVo5SSKCM=' 
WHERE 
  key_id = 'b6b70c286ba4dd4f37fb11f22d583843a3db0d83abad20f755c8a260df7e65f1' 
  AND (
    token = 'bSK1sEDLj+Xc2yelHK/mtR116pjIxJqT93rVo5SSKCM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020