UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ow53ZJEy/PqJcHmhFBhCt89LAsR9pi//FZGkT5B1kD4='
WHERE
key_id = 'a89194c96e334cdf1f07cc19214cc3c5b598b62a804b66ad76d51e5f0ce48569'
AND (
token = 'Ow53ZJEy/PqJcHmhFBhCt89LAsR9pi//FZGkT5B1kD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)