UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WYEbyH+Ocb9OcwR3JPvU9/knzFiq1F/hoN7i9jUi4Co='
WHERE
key_id = '00f61ca961f8d03e7a2f588048cd87def41439af9d79bf7698ff4904f48fe51c'
AND (
token = 'WYEbyH+Ocb9OcwR3JPvU9/knzFiq1F/hoN7i9jUi4Co='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)