UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V6ZdToh1r0f5PuZwxhNP08aYuzEelVCJIoywxUKmbCg='
WHERE
key_id = 'a133a899dbab5110f28b62b4497e5c5bc826a7828ac685086102bde0ca2796cc'
AND (
token = 'V6ZdToh1r0f5PuZwxhNP08aYuzEelVCJIoywxUKmbCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)