UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c8ohnyTxKxEFPYzP06YQu3baaleZ8h7WkwjDyh9E6+o='
WHERE
key_id = '1a88f4d6653f97bece8e2d140fd45ccfaf9fbc69a59bb21f541e07aaf82e15b8'
AND (
token = 'c8ohnyTxKxEFPYzP06YQu3baaleZ8h7WkwjDyh9E6+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)