UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '04hhZfR7MFfQFWA4qvTo3jS44tp0/DmWzTN/7WzC1fM='
WHERE
key_id = 'd7bd907bdb6c95f880520e31038bb75b0c169c97dce42115ebe0406476ec1ac2'
AND (
token = '04hhZfR7MFfQFWA4qvTo3jS44tp0/DmWzTN/7WzC1fM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)