UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UnZ7TCBIja2dPsjk0iAfJvPslTjnAHeg6PRCyGImFfs='
WHERE
key_id = '38228b157d6e0760a014dc341b82309493e0db41503f198e4a12fed2b3c60b76'
AND (
token = 'UnZ7TCBIja2dPsjk0iAfJvPslTjnAHeg6PRCyGImFfs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)