UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3BH14W2FCDZaUtXWZfw9Hum+p16IX2mYtRqqhWc32i8='
WHERE
key_id = '1aed8de2aef28b98bbff2f6945bbc14d0aa85b24d46b53d9ebb55a0d9703b144'
AND (
token = '3BH14W2FCDZaUtXWZfw9Hum+p16IX2mYtRqqhWc32i8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)