UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EqVD82sQpLDqAaNSJO8HwnySLR+UEY476BDmdb2abAE='
WHERE
key_id = '6c20e16b314b5afd8522e4a5aae2fe753c02cb6708569052d85aaece742ed5d4'
AND (
token = 'EqVD82sQpLDqAaNSJO8HwnySLR+UEY476BDmdb2abAE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)