UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NPy5CTLbBM1QyyRt8FnAk4TmaWVGz9x85uMi1cf47cM='
WHERE
key_id = '5e69edd0df0ed61166884c65445b41a70b958a640775ecd0fc378b9e8f215ed9'
AND (
token = 'NPy5CTLbBM1QyyRt8FnAk4TmaWVGz9x85uMi1cf47cM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)