UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wHytwyfzoXszE80RXTE72CIzO++w+iZocV3S+jWaP6M='
WHERE
key_id = '6a6f5b80ec29656452bc8cf06602e7cd766dcae2d846ea58a0ef51458f1af10b'
AND (
token = 'wHytwyfzoXszE80RXTE72CIzO++w+iZocV3S+jWaP6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)