UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Dy3sR6cfh+WtBWWReqiaxXtAGl2oQdsGUU6QjFxzBk=' 
WHERE 
  key_id = '23385118d8a659527ca304782fb1ab8be3d3d5a32e7295676ae768661943d576' 
  AND (
    token = '7Dy3sR6cfh+WtBWWReqiaxXtAGl2oQdsGUU6QjFxzBk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024