UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qtyKSkufm6wRL1mO3XAD5hw055tOkpCYEb9Xz7HkuZk='
WHERE
key_id = '103e08d667872039237bf960db8c1bf4a658d25e1573146a53335f244e77a659'
AND (
token = 'qtyKSkufm6wRL1mO3XAD5hw055tOkpCYEb9Xz7HkuZk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)