UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '11SP/JStuE33eyAQUQsvoxvb35tOr/qT2Dl9yR70Z5c='
WHERE
key_id = '1d84aa48f1c047bc92728a3a39209beb1cfb2c59dd7a8b66a0a0c70c1f0bd45d'
AND (
token = '11SP/JStuE33eyAQUQsvoxvb35tOr/qT2Dl9yR70Z5c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)