UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ARVn9nvLjyCVbslDE4a/7xHVbIa2Xel95UPYPF49rHQ='
WHERE
key_id = 'b529ab209e308ef894a73ad7216c8fce429298965bf6668d0de68da45b381838'
AND (
token = 'ARVn9nvLjyCVbslDE4a/7xHVbIa2Xel95UPYPF49rHQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)