UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ALNNECWoqVFJ0YMptXGnADYvhjRYo5TT2BJYK7Gnds='
WHERE
key_id = 'b9fa53ff523a50b30744e8134f6800d95897dddbf9235f592f82ab0f3b9cea84'
AND (
token = '7ALNNECWoqVFJ0YMptXGnADYvhjRYo5TT2BJYK7Gnds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)