UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fyXG/OnCF+UM/GQVC6KNRbE5kDCOfm6q9KnyueGq1tY='
WHERE
key_id = '1947b44cbc5e35a807fc0c1adf0c4552552a5a16152dfe24553a73c7a3602b76'
AND (
token = 'fyXG/OnCF+UM/GQVC6KNRbE5kDCOfm6q9KnyueGq1tY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)