UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AfNRLhs/vqwA6oKNyPKMMfN/li4IrKusKgY8UcE1NZg='
WHERE
key_id = '00e56b4fe0f4fc4d0d405c9f11061c6f7a165f39cd6e20f97ec7015aa21d1ee7'
AND (
token = 'AfNRLhs/vqwA6oKNyPKMMfN/li4IrKusKgY8UcE1NZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)