UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'facYUVul6qRGXJIXGdNCqKDFziW5hfoGCszh83yfgBo='
WHERE
key_id = '62d6d2c5ea106a2b1e817566c5f903665d80e70c39fbaad08b420c5112b624db'
AND (
token = 'facYUVul6qRGXJIXGdNCqKDFziW5hfoGCszh83yfgBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)