UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vpfiKQI4BT08tpOYgNUo81ttQAU3uO9AeFOB3gyODjg='
WHERE
key_id = 'bff399d972eecda156e77507d0f1f54b8f858c263099a49c63aed9e2961b2dab'
AND (
token = 'vpfiKQI4BT08tpOYgNUo81ttQAU3uO9AeFOB3gyODjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)