UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lbskQ+tdOuyA4NV8PoFxeP2nTOu7O7Mv8qCXf2dPqCo='
WHERE
key_id = 'cc41500db127d13036879d89af73f6aed1e771859e0dd9d48f39d229af257f4c'
AND (
token = 'lbskQ+tdOuyA4NV8PoFxeP2nTOu7O7Mv8qCXf2dPqCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)