UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6zlujudzJE3UG+ALfE3Hs6ao6lSbrxO7nz7TI0V+CLw='
WHERE
key_id = 'b4cfb4471aa8d9aa444f894a343639c7961489100d2be86e2d91f6162b33e689'
AND (
token = '6zlujudzJE3UG+ALfE3Hs6ao6lSbrxO7nz7TI0V+CLw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)