UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '33LS0xKArZe+7qhAZwYfYfSPciJOwuKBcHikyEAXrX0='
WHERE
key_id = '9aac71c98e7a1163feefc74bfcdc00cdb165eb1d277a2f742605487bc65e32de'
AND (
token = '33LS0xKArZe+7qhAZwYfYfSPciJOwuKBcHikyEAXrX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)