UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wznpLu/vRadDdx6DRRfRZPTD61rutcF/C7vA/x3aPhw='
WHERE
key_id = '2b26ea9eb6f4254e3b7f84d05066737f541a8d8389924a7baaf798f7bc8cc881'
AND (
token = 'wznpLu/vRadDdx6DRRfRZPTD61rutcF/C7vA/x3aPhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)