UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oil5rb+ZnOK5Zwv3/LLqskW/MCgtSOSeP7MRl3M8Q2M='
WHERE
key_id = 'f48842c53e4916e24204c1de0e32bd80688cd4393d2e335cbb6cbe2a7eb0ac38'
AND (
token = 'oil5rb+ZnOK5Zwv3/LLqskW/MCgtSOSeP7MRl3M8Q2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)