UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tzCYMp1H+BcxzWRve4aoHP9IkPe4oO6AyRZpcZjQz8k='
WHERE
key_id = 'a80fd21ad87db280059ad4e44a801f0d6d957a03fd0253c5751d40e8ddb3160d'
AND (
token = 'tzCYMp1H+BcxzWRve4aoHP9IkPe4oO6AyRZpcZjQz8k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)