UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zc04TW/Jo97kbYvM+0CRRHPnWD1KiTB1dpseC8gcBvg='
WHERE
key_id = 'ae7cc6fe6785bc7823a3ecc4311099341e23b611d68d739e4475e24c2d45e00b'
AND (
token = 'zc04TW/Jo97kbYvM+0CRRHPnWD1KiTB1dpseC8gcBvg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)