UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dVzM6n711khpxZHVvShBEbVt1I+lBj+6Lg6ONzKuY14='
WHERE
key_id = 'aef19c07daf45686f7728773d7090ee9f8b0c1e19f414a609cbdfdb4a0b58ae3'
AND (
token = 'dVzM6n711khpxZHVvShBEbVt1I+lBj+6Lg6ONzKuY14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)