UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LeZyPhl/1OB8E9ezWU36icLLe4yLi6MuCacPKKYTYtI='
WHERE
key_id = 'f546ea83096c16fa3c8d600ee1a099b2db3abf60345d2be1d1e27ff160483bce'
AND (
token = 'LeZyPhl/1OB8E9ezWU36icLLe4yLi6MuCacPKKYTYtI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)