UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gd/QQaOB81aV1d+mY4EhfTEWMLoa2mvH9TxreK5abVg=' 
WHERE 
  key_id = '6f3fff92face73b064ad11618dae4768acf428677a40f461cb9f5f03088c5528' 
  AND (
    token = 'Gd/QQaOB81aV1d+mY4EhfTEWMLoa2mvH9TxreK5abVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024