UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UacLZzehl9xkKo5FafoBTpYAo7MlozsO//WkkywVci4='
WHERE
key_id = '2e6d837a41013307f3c5d266db0113241454eb2bc254c7657ad94af317749eaa'
AND (
token = 'UacLZzehl9xkKo5FafoBTpYAo7MlozsO//WkkywVci4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)