UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FhQ7mNp5FCs+hMxnTl5Ql682ZZw4KrurAVLWHqkPHJc='
WHERE
key_id = 'a602e4235458135646657c641353ec2871a060662dababca8c05c2343e24e1fb'
AND (
token = 'FhQ7mNp5FCs+hMxnTl5Ql682ZZw4KrurAVLWHqkPHJc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)