UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XRMosb1jG4kpjpqn3iNGGSlABnx5Bhql4OZyRafTh/A='
WHERE
key_id = 'f9edd0050835b200d0fe2044763441ba9e9e049b512bf6cdc5e15dbebc5f7d73'
AND (
token = 'XRMosb1jG4kpjpqn3iNGGSlABnx5Bhql4OZyRafTh/A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)