UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'enpqvqB24hCepB/068Vwd+YnqEq/uD23B2f4epEBujQ='
WHERE
key_id = '52b0570eb993f9d59e95425a2cd7224e4974a6f5db4f529b0759992c5f9c3584'
AND (
token = 'enpqvqB24hCepB/068Vwd+YnqEq/uD23B2f4epEBujQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)