UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B/Z8oY1jUYUuYvGsMLNT5UJ8hwNp7vhMrQTKC6YFR88='
WHERE
key_id = '24f7b617be66c503236d79f693ded757803acf249b42254e5c3f5ce6f5ee2ac4'
AND (
token = 'B/Z8oY1jUYUuYvGsMLNT5UJ8hwNp7vhMrQTKC6YFR88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)