UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eBsKs0ItnGS/44V5wa2QuRY8f9u0lmWT9fB3ZcxXIrU=' 
WHERE 
  key_id = '6751bd0b0cc594414d225d2511efba2a4a23e82ca239e847014087b7f1ce5e5f' 
  AND (
    token = 'eBsKs0ItnGS/44V5wa2QuRY8f9u0lmWT9fB3ZcxXIrU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033