UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aKKNUS+FIR6LDJYKg+Acbykbg8WILPx6/Aa4WzR66jw='
WHERE
key_id = '334b5dba4418f1c8cd57a0f429cd054a0c1f58d7c95b754c4019b61d7e2d6592'
AND (
token = 'aKKNUS+FIR6LDJYKg+Acbykbg8WILPx6/Aa4WzR66jw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)