UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uRHF/0r+HfoRz/Rmw/kWP8fyJOU47FkjIfDTo+FlzgE='
WHERE
key_id = '58073347e475ac30d54d4e00e180cb1085f10e461d3be2ba09ba8cb05982fec2'
AND (
token = 'uRHF/0r+HfoRz/Rmw/kWP8fyJOU47FkjIfDTo+FlzgE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)