UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wky2bYxFFps0QSCeIVuxEWmHwciwYZoOb8ffTWldeMI='
WHERE
key_id = '884bee159d9aad9a7ef36a9b85e83001877c710ddc163e3af36e53385ee65f0d'
AND (
token = 'wky2bYxFFps0QSCeIVuxEWmHwciwYZoOb8ffTWldeMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)