UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qmymWMLmMX5U5z+LF54ic1p8i3gCrzVmRyM/JQ7LHGE='
WHERE
key_id = 'ddb1283f48bb83ebff75dd95d14bb7d745e35acb285c8f8871a37ad4e013d0d2'
AND (
token = 'qmymWMLmMX5U5z+LF54ic1p8i3gCrzVmRyM/JQ7LHGE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)