UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QWpTxVF5Fb3L0ZOwZTx+txvkgEoIOpD+3peOWFzgjKw='
WHERE
key_id = '09922502570fb22c3bb3005657af1e0ecfbf807ed2bc094592817527651dfadf'
AND (
token = 'QWpTxVF5Fb3L0ZOwZTx+txvkgEoIOpD+3peOWFzgjKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)