UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pmqd2XLQSX9vve55V5XnQU8D+doJt4w0UUfd8W47eJU='
WHERE
key_id = '3966298d86f3a35069cb42f1ece13c1fec2a318f55625037d6fd5b3d1184abfa'
AND (
token = 'pmqd2XLQSX9vve55V5XnQU8D+doJt4w0UUfd8W47eJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)