UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ayA0zki3GBa6aVwJXnIR8MU3++v9mdp4lEhILV9wiG8='
WHERE
key_id = '66bb71236a80eac2ab7ead4873793353fab7d8fce40b39ab1cd6753ce1aea2ef'
AND (
token = 'ayA0zki3GBa6aVwJXnIR8MU3++v9mdp4lEhILV9wiG8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)